package unteractivities.p3_fitnessapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import controler.p3_fitnessapp.R;

public class UActNutrients2 extends Activity {
	
	private int _weight;
	private int _heigth;
	private String _bodytype;
	private String _phase;
	
	

	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.uact_nutrients_calc_2);
		
		
		Intent intent = getIntent();
		
		_weight = intent.getIntExtra("weight", 0);
		_heigth = intent.getIntExtra("heigth", 0);
		_bodytype = intent.getStringExtra("bodytype");
		_phase = intent.getStringExtra("phase");
		
//		Log.d(null, "intent activity " + intent.getIntExtra("smrlight", 0));
		
		Log.d(null, "w " + _weight + ", h " + _heigth + " , b " + _bodytype + " , p " + _phase);

	}

	public void onButtonClick(View view) {
		
		//Textfelder auslesen
		EditText work = (EditText) findViewById(R.id.edit_work);
		EditText sport = (EditText) findViewById(R.id.edit_sport);

		//Textfelder in Int schreiben
		int workCal = Integer.parseInt(work.getText().toString());
		int sportCal = Integer.parseInt(sport.getText().toString());


		switch (view.getId()) {
		case R.id.btn_nutrient_calculate:
			
			
			
			
			
			Intent intentSportWork = new Intent();
			
			intentSportWork.setClassName(getPackageName(), "unteractivities.p3_fitnessapp.UActNutrients3");
			intentSportWork.putExtra("weight", _weight);
			intentSportWork.putExtra("heigth", _heigth);
			intentSportWork.putExtra("bodytype", _bodytype);
			intentSportWork.putExtra("phase", _phase);
			intentSportWork.putExtra("work", workCal);
			intentSportWork.putExtra("sport", sportCal);
			
			
			startActivity(intentSportWork);
			
		default:
			break;
		}

	}

	/*
	 * ==========================================================================
	 * Globale Variablen
	 * ========================================================
	 */

	/*
	 * ==========================================================================
	 * Android Methoden ========================================================
	 */

	/*
	 * ==========================================================================
	 * Benutzer Interaktion (Buttons ... )
	 * ========================================================
	 */

	/*
	 * ==========================================================================
	 * Eigene Methoden ========================================================
	 */

	/*
	 * ==========================================================================
	 * Debug Methoden ========================================================
	 */

	/*
	 * ==========================================================================
	 * Getter und Setter
	 * ========================================================
	 */

}
